library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.NUMERIC_STD.ALL;


entity hex_lookup is
	Port ( 	
			to_hexdisplay  : in unsigned(15 downto 0);
			
			hex0  : out std_logic_vector(6 downto 0);
			hex1  : out std_logic_vector(6 downto 0);
			hex2  : out std_logic_vector(6 downto 0);
			hex3  : out std_logic_vector(6 downto 0)
		);		 
end hex_lookup;


architecture Behavioral of hex_lookup is
	

begin

	process (to_hexdisplay)
	begin
	
	case to_hexdisplay(3 downto 0) is
		when "0001" => hex0 <= "1111001";	
		when "0010" => hex0 <= "0100100"; 	
		when "0011" => hex0 <= "0110000"; 	
		when "0100" => hex0 <= "0011001"; 	
		when "0101" => hex0 <= "0010010"; 	
		when "0110" => hex0 <= "0000010"; 	
		when "0111" => hex0 <= "1111000"; 	
		when "1000" => hex0 <= "0000000"; 	
		when "1001" => hex0 <= "0011000"; 	
		when "1010" => hex0 <= "0001000";
		when "1011" => hex0 <= "0000011";
		when "1100" => hex0 <= "1000110";
		when "1101" => hex0 <= "0100001";
		when "1110" => hex0 <= "0000110";
		when "1111" => hex0 <= "0001110";
		when "0000" => hex0 <= "1000000";
	end case;
	
	case to_hexdisplay(7 downto 4) is
		when "0001" => hex1 <= "1111001";	
		when "0010" => hex1 <= "0100100"; 	
		when "0011" => hex1 <= "0110000"; 	
		when "0100" => hex1 <= "0011001"; 	
		when "0101" => hex1 <= "0010010"; 	
		when "0110" => hex1 <= "0000010"; 	
		when "0111" => hex1 <= "1111000"; 	
		when "1000" => hex1 <= "0000000"; 	
		when "1001" => hex1 <= "0011000"; 	
		when "1010" => hex1 <= "0001000";
		when "1011" => hex1 <= "0000011";
		when "1100" => hex1 <= "1000110";
		when "1101" => hex1 <= "0100001";
		when "1110" => hex1 <= "0000110";
		when "1111" => hex1 <= "0001110";
		when "0000" => hex1 <= "1000000";
	end case;
	
	case to_hexdisplay(11 downto 8) is
		when "0001" => hex2 <= "1111001";	
		when "0010" => hex2 <= "0100100"; 	
		when "0011" => hex2 <= "0110000"; 	
		when "0100" => hex2 <= "0011001"; 	
		when "0101" => hex2 <= "0010010"; 	
		when "0110" => hex2 <= "0000010"; 	
		when "0111" => hex2 <= "1111000"; 	
		when "1000" => hex2 <= "0000000"; 	
		when "1001" => hex2 <= "0011000"; 	
		when "1010" => hex2 <= "0001000";
		when "1011" => hex2 <= "0000011";
		when "1100" => hex2 <= "1000110";
		when "1101" => hex2 <= "0100001";
		when "1110" => hex2 <= "0000110";
		when "1111" => hex2 <= "0001110";
		when "0000" => hex2 <= "1000000";
	end case;
	
	case to_hexdisplay(15 downto 12) is
		when "0001" => hex3 <= "1111001";	
		when "0010" => hex3 <= "0100100"; 	
		when "0011" => hex3 <= "0110000"; 	
		when "0100" => hex3 <= "0011001"; 	
		when "0101" => hex3 <= "0010010"; 	
		when "0110" => hex3 <= "0000010"; 	
		when "0111" => hex3 <= "1111000"; 	
		when "1000" => hex3 <= "0000000"; 	
		when "1001" => hex3 <= "0011000"; 	
		when "1010" => hex3 <= "0001000";
		when "1011" => hex3 <= "0000011";
		when "1100" => hex3 <= "1000110";
		when "1101" => hex3 <= "0100001";
		when "1110" => hex3 <= "0000110";
		when "1111" => hex3 <= "0001110";
		when "0000" => hex3 <= "1000000";
	end case;

	
	end process;

end Behavioral;









